#include "pch.h"
#include "DataTypes.h"

namespace AirplaneLoadingWK
{

    Equipment::Equipment():
        _id(0),
        _gravityY(0.0),
        _weight(0.0)
    {
        _axleLoadList = gcnew Generic::List<AxleLoad^>(0);
    }

    bool Equipment::addAxleLoad(AxleLoad^ axleLoad)
    {
        if (axleLoad == nullptr){   return false;}

        _axleLoadList->Add(axleLoad);
        return true;
    }

    LoadedEquipmentList::LoadedEquipmentList() :_countOfLoadedAirplane(0)
    {
        _loadedEquipmentList = gcnew Generic::List<LoadedEquipment^>(0);
    }


    bool LoadedEquipmentList::addEquipment(LoadedEquipment^ loadedEquipment)
    {
        if (loadedEquipment == nullptr) { return false; }
        _loadedEquipmentList->Add(loadedEquipment);
        return true;
    }

    //bool LoadedEquipmentList::addEquipment(LoadedEquipment^ loadedEquipment)
    //{
    //    if (loadedEquipment == nullptr){  return false;}
    //    
    //    //for (int index = 0 ; index < _loadedEquipmentList->Count; index++)
    //    //{
    //    //    if (loadedEquipment->_id == _loadedEquipmentList->IndexOf(index))
    //    //    {
    //    //    }
    //    //}
    //    
    //    //foreach(LoadedEquipment^ dinosaur in _loadedEquipmentList)
    //    //{
    //    //    //Console.WriteLine(dinosaur);
    //    //}
    //    _loadedEquipmentList->Add(loadedEquipment);
    //    return true;
    //}

    Airplane::Airplane() :
        _gravityY(0.0), 
        _minY(0.0),_maxY(0.0),
        _weight(0.0),
        _locationTypeOfStartLoading(0)
    {
        _weightLimitOfAreaList = gcnew Generic::List<WeightLimit^>(0);
    }

    bool Airplane::addWeightLimit(WeightLimit^ weightLimit)
    {
        if (weightLimit == nullptr) { return false; }

        _weightLimitOfAreaList->Add(weightLimit);
        return true;
    }
}